package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家操作日志", model = "商家操作日志")
@Entity
@Table(name = "bs_merchant_log")
@Comment("商家操作日志表")
public class MerchantLog extends AbstractEntity {

    @Comment("商家ID")
    @FormField(title = "商家", sortNum = "1", type = InputType.select, required = true)
    private Long merchantId;

    @Comment("操作用户ID")
    @FormField(title = "操作用户", sortNum = "2", type = InputType.select)
    private Long userId;

    @Comment("操作类型")
    @SearchItem(name = "operationType", key = "operationType", label = "操作类型")
    @FormField(title = "操作类型", sortNum = "3", grid = true, required = true)
    @Column(length = 50, nullable = false)
    private String operationType;

    @Comment("操作描述")
    @SearchItem(name = "operationDesc", key = "operationDesc", label = "操作描述")
    @FormField(title = "操作描述", sortNum = "4", grid = true)
    @Column(length = 500)
    private String operationDesc;

    @Comment("操作数据")
    @FormField(title = "操作数据", sortNum = "5", type = InputType.textarea)
    @Column(columnDefinition = "text")
    private String operationData;

    @Comment("IP地址")
    @FormField(title = "IP地址", sortNum = "6", grid = true)
    @Column(length = 50)
    private String ipAddress;

    @Comment("用户代理")
    @FormField(title = "用户代理", sortNum = "7")
    @Column(length = 500)
    private String userAgent;
} 